home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Localization Tools / SCM Verifier 1.0a12 / compare-disks < prev    next >
Encoding:
Text File  |  1990-02-02  |  2.5 KB  |  86 lines  |  [TEXT/MPS ]

  1. #
  2. #    compare-disks
  3. #    MPW Shell script
  4. #    Malcolm H. Teas
  5. #    Apple Computer, Inc.
  6. #
  7. #    Function:
  8. #    Using the correspondence filelist, compare each corresponding set of file's
  9. #    resources and data fork.  Use the MPW tools resdiff and equal to help 
  10. #    generate the report.
  11. #
  12. #    In-Outputs:
  13. #    The first input parameter is the filename of a list of the corresponding
  14. #    files.  The second is the "d" for "disk", or "f" for "folder" parameter.
  15. #    The report is written out to the current MPW window.  The exit status is
  16. #    the only output parameter.
  17. #
  18.  
  19. #    Set some debugging variables.
  20. set save-exit {exit}
  21. set exit 0
  22. set save-echo {echo}
  23. set echo 0
  24.  
  25. #    Establish the filelist.
  26. set filelist "{1}"
  27. open "{filelist}"
  28. find • "{filelist}"
  29.  
  30. #    And set up the folder/disk parm too.
  31. set folder "{2}"
  32.  
  33. #    Set up the rNames directory variable
  34. set rNames "{3}"
  35.  
  36. #    Loop on the filenames from the filelist.
  37. loop
  38.  
  39. #    Get the filenames in the loop variables USfile and localfile.
  40.     # Get the US name from the filelist.
  41.     find /•≈∞/ "{filelist}"        # Get a line from filelist.
  42.     break if `count -l "{filelist}.§"` == 0        # Exit loop if end.
  43.     set USfile "`catenate "{filelist}.§"`"
  44.     
  45.     # Get the test name from the filelist.
  46.     find /•≈∞/ "{filelist}"        # Get the next line from filelist.
  47.     if {status} == 2            # This filelist is bad, no matching name.
  48.         confirm "There is a mismatched file in the filelist."
  49.         exit 3                    # Can't continue.
  50.     end
  51.     set localfile "`catenate "{filelist}.§"`"
  52.     
  53. #    If it's a folder, then add the folder colon now so we can find the file. 
  54.     if ({folder} == "f") OR ({folder} == "zf")    
  55.         set USfile        ":{USfile}"
  56.         set localfile    ":{localfile}"
  57.     end
  58.     
  59. #    Tell the user what is happening by adding the file header.
  60. #    We don't want to see this text if we are in the special case of creating 
  61. #    the resource name text files!
  62.     if ({folder} == "d") OR ({folder} == "f")
  63.         echo "-- Master file: ∂"{USfile}∂","
  64.         echo "-- Test file: ∂"{Localfile}∂".∂n"
  65.     end
  66.  
  67. #    Now let's see if we are supposed to create the rNames.S files, or go straight
  68. #    ahead and do the compare....
  69.  
  70.     if ({folder} == "zd") OR ({folder} == "zf")        #    "z" flags us that we want to create the .rNames.S files...
  71.         create.rnamefile "{USfile}"  "{rNames}"
  72.     else
  73.         resdiff        "{USfile}"  "{Localfile}" "{rNames}"        # Compare the resources.
  74.         equal -d    "{USfile}"    "{Localfile}"                    # Compare the data fork.
  75.     end
  76.         
  77. #     Add blank line to the output in between files.
  78.     echo                         
  79.     
  80. end    # End of loop on the files in the correspondence filelist.
  81.  
  82. #    Clean up and exit.
  83. close "{filelist}"
  84. set exit {save-exit}
  85. set echo {save-echo}
  86. exit 0